import request from '@/utils/http'

// 获取spu列表
export const reqGetSpuList = (page, limit, category3Id) => {
  return request.get(`/admin/product/${page}/${limit}?category3Id=${category3Id}`)
}

// 获取spu全部品牌数据列表
export const reqGetBaseTrademarkList = () => {
  return request.get('/admin/product/baseTrademark/getTrademarkList')
}
// 获取spu图片列表
export const reqGetSpuImageList = (spuId) => {
  return request.get(`/admin/product/spuImageList/${spuId}`)
}

// 获取spu已有的销售属性列表
export const reqGetSpuSaleAttrList = (spuId) => {
  return request.get(`/admin/product/spuSaleAttrList/${spuId}`)
}

// 获取所有的销售属性
export const reqGetAllSaleAttrList = () => {
  return request.get('/admin/product/baseSaleAttrList')
}


// 新增spu
export const reqAddSpu = (spu) => {
  return request.post('/admin/product/saveSpuInfo', spu)
}

// 修改spu
export const reqUpdateSpu = (spu) => {
  return request.post('/admin/product/updateSpuInfo', spu)
}

// 删除spu
export const reqDeleteSpu = (spuId) => {
  return request.delete(`/admin/product/deleteSpu/${spuId}`)
}

// 新增一个sku
export const reqAddSku = (skuInfo) => {
  return request.post('/admin/product/saveSkuInfo', skuInfo)
}

// 查看已有的sku列表
export const reqGetSkuList = (spuId) => {
  return request.get(`/admin/product/findBySpuId/${spuId}`)
}
